<template>
  <div>
    <h2>TsInfo</h2>
    {{ count }} <button @click="count++">+</button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      count: 0
    };
  },
  created() {
    console.log('created');
  },
  mounted() {
    console.log('mounted');
  },
  updated() {
    console.log('updated');
  },
  destroyed() {
    console.log('destroyed');
  },

  beforeDestroy() {
    console.log('beforeDestroy');
  },

  // keep-alive
  activated() {//激活组件
    console.log('activated');
  },
  deactivated() {
    //组件失活（销毁）
    console.log('deactivated');
  }

};
</script>